﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using Lays.Manage.Core.News;
using Lays.Manage.Core.News.Dtos;

namespace Lays.Manage.Web.Controllers
{
    public class NewsController : Controller
    {
        private INewsAppService _newsService;
        public NewsController(INewsAppService newsService)
        {
            _newsService = newsService;
        }
        // GET: News
        public async Task<ActionResult> Index()
        {
            GetNewsInput input = new GetNewsInput();
            input.FilterText = "";
            input.SkipCount = 0;
            input.MaxResultCount = 10;
            var list = await _newsService.GetPagedNewssAsync(input);
            
            return View(list);
        }

        public ActionResult AddComment(int newId)
        {
            if (newId > 0)
            {
                RedirectToAction("Index");
            }
            return View();
        }
    }
}